package JianZhiOffer;

import java.util.Scanner;

/**
 * @author fly
 * @create 2021--03--16--12:44
 */
public class Offer3 {

    public static void main(String[] args){
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int[] a=new int[n];
        int[] b=new int[100010];
        for(int i=0;i<n;i++){
            a[i]=sc.nextInt();
            b[a[i]]++;
        }
        for(int i=0;i<n;i++){
            if(b[a[i]]>1){
                System.out.println(a[i]);
                break;
            }
        }
    }
}
